package com.example.owner.lettery1.ui;

import android.net.http.SslError;
import android.os.Bundle;
import android.view.View;
import android.webkit.SslErrorHandler;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import com.example.owner.lettery1.R;
import com.example.owner.lettery1.base.BaseFragment;
import butterknife.BindView;
import butterknife.Unbinder;
public class ServiceFragment extends BaseFragment {



    @BindView(R.id.web_view_service)
    WebView webViewService;
    Unbinder unbinder;

    public static ServiceFragment newInstance() {
        return new ServiceFragment();
    }

    @Override
    protected void onInitView(View view, Bundle savedInstanceState) {
        WebSettings settings = webViewService.getSettings();
        settings.setJavaScriptEnabled(true);


    settings.setUseWideViewPort(true);//设定支持viewport
    settings.setLoadWithOverviewMode(true);
    settings.setBuiltInZoomControls(true);
    settings.setSupportZoom(true);//设定支持缩放

    //打开的网址
    webViewService.loadUrl("http://chat.livechatvalue.com/chat/chatClient/chatbox.jsp?companyID=969800&configID=62573&jid=4113353306");
        webViewService.setWebViewClient(new WebViewClient(){

            @Override
            public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
                handler.proceed();
            }
        });
    }


    @Override
    protected int getLayoutId() {
        return R.layout.fragment_service;
    }


    @Override
    public void onDestroyView() {
        super.onDestroyView();
        unbinder.unbind();

    }


}
